#define _CRT_SECURE_NO_WARNINGS

int* twoSum(int* numbers, int numbersSize, int target, int* returnSize)
{
	int* ans = malloc(sizeof(int) * 2);
	*returnSize = 2;
	memset(ans, -1, sizeof(ans));
	int fast = numbersSize - 1, slow = 0;
	while (slow < fast)
	{
		if (numbers[slow] + numbers[fast] < target)
			slow++;
		else if (numbers[slow] + numbers[fast] > target)
			fast--;
		else
		{
			ans[0] = slow + 1;
			ans[1] = fast + 1;
			return ans;
		}
	}
	return ans;
}